package com.g001.enums;

public enum Animation {

	IDLE(0), // nothing happend or some idle animation
	SWITCH(1), // blocks are switching
	AUTOSOLVE(2), // block disapear in explosion with sound
	SWITCHBACK(3), // block return to previous place (switch back) with a bad sound
	FALL(4), // Blocks that need to fall, are falling before to return to idle animation
	MATCH_AUTOMOVE(5),
	ADD_BLOCK(6), 
	BATTLE_OVER(7),
	GAME_OVER(8),
	SHUFFLE(9)
	;
	private int id;
	
	Animation(final int id){
		this.id = id;
	}
	
	public int getId(){
		return id;
	}
	
	public static Animation getAnimations(final int id){
		switch(id){
			case 0 : return IDLE;
			case 1 : return SWITCH;
			case 2 : return AUTOSOLVE;
			case 3 : return SWITCHBACK;
			case 4 : return FALL;
			case 5 : return MATCH_AUTOMOVE;
			case 6 : return ADD_BLOCK;
			case 7 : return BATTLE_OVER;
			case 8 : return GAME_OVER;
			case 9 : return SHUFFLE;
			default : throw new IllegalArgumentException("The following animation id '"+id+"' is incorrect.");
		}
	}
}
